﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace CommonLib {
    public class Ray {
        private Vector3 eye, direction;
        public Ray(Vector3 ey, Vector3 dr) {
            Eye = ey;
            Dir = dr;
        }
        public Vector3 Eye {
            set {
                this.eye = value;
            }
            get {
                return this.eye;
            }
        }
        public Vector3 Dir {
            set {
                DoubleTester.Assert(value.norm(), 1);
                this.direction = value;
            }
            get {
                return this.direction;
            }
        }

        public Ray normalize() {
            direction.normalize();
            return this;
        }
    }
}
